package com.yuqiao.read.design.command;

public class RemoteLoalder {
    public static void main(String[] args) {
        RemoteController remote = new RemoteController();
        Stereo stereo = new Stereo();
        Light light = new Light();
        StereoOnWithCDCommand stereoOn = new StereoOnWithCDCommand(stereo);
        StereoOffCommand stereoOff = new StereoOffCommand(stereo);
        LightOnCommand lightOn = new LightOnCommand(light);
        LightOffCommand lightOff = new LightOffCommand(light);
        remote.setCommond(0,stereoOn,stereoOff);
        remote.setCommond(1,lightOn,lightOff);
        System.out.println("args = [" + remote + "]");
        remote.onButtonWasPressed(0);
        remote.offButtonWasPressed(0);
        remote.onButtonWasPressed(1);
        remote.offButtonWasPressed(1);

    }
}
